import java.util.Objects;

public class Mpoint {
    private int abscissa;//横坐标
    private int ordinate;//纵坐标
    public Mpoint(int row,int list){
        this.abscissa =row;
        this.ordinate =list;
    }
    public Mpoint(){

    }

    @Override
    public boolean equals(Object o) {//重写equals方法
        if (this == o) return true;//同一个对象
        if (o == null || getClass() != o.getClass()) return false;
        Mpoint mpoint = (Mpoint) o;
        return abscissa == mpoint.abscissa ;//横坐标相等即可
    }

    @Override
    public String toString() {//当直接输出Mpoint对象时，则输出此对象的点坐标信息。

        return "点坐标(" +
                abscissa +
                ","+ ordinate +
                ')';
    }

    @Override
    public int hashCode() {
        return Objects.hash(abscissa, ordinate);
    }

    //访问器
    public int getAbscissa() {
        return abscissa;
    }

    public void setAbscissa(int abscissa) {
        this.abscissa = abscissa;
    }

    public int getOrdinate() {
        return ordinate;
    }

    public void setOrdinate(int ordinate) {
        this.ordinate = ordinate;
    }
}
